function SuperType(str){
  this.str = str??'none'
  this.arr = [1,2,3]
  this.fn = ()=>console.log(1)
}
const superType = new SuperType('superType')
console.log(superType)

// function SubType (num){
//   this.num = num
// }

/**
 * 优点：父类方法可以复用
 * 缺点：父类的引用属性会被所有子类实例共享
 *       子类构建实例时不能向父类传递参数
 */


// const subType = new SubType()
const subType = Object.create(new SuperType())
subType.num = 123
console.log(subType)
